package com.mike.bdb.model;
import org.apache.commons.lang.builder.EqualsBuilder;

import com.sleepycat.persist.model.Entity;
import com.sleepycat.persist.model.PrimaryKey;

@Entity
public class Player {

	public static final byte SEX_FEMALE = 0;
	public static final byte SEX_MALE = 1;
	
	@PrimaryKey(sequence="ID")
	private int id;
	
	private String userName;

	private byte sex = SEX_FEMALE;
	
	private String email;
	
	public Player(String userName) {
		this.userName = userName;
	}
	
	public Player(String userName, String email) {
		this.userName = userName;
		this.email = email;
	}
	
	public Player(String userName, String email, byte sex) {
		this.userName = userName;
		this.email = email;
		this.sex = sex;
	}
	
	public boolean equals(Object other) {
		return EqualsBuilder.reflectionEquals(this, other);
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public byte getSex() {
		return sex;
	}

	public void setSex(byte sex) {
		this.sex = sex;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getId() {
		return id;
	}

}
